home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 018a / amac41.zip / RFR009.QM < prev    next >
Text File  |  1991-08-26  |  28KB  |  617 lines

  1. *                               RFR009.QM
  2. *                        Written By Tom Hogshead
  3. *                       [ See RFRMxx.QM For Use ]
  4. *                                8/25/91
  5. *  Key       Subfile                       Description                  Bytes
  6. * =====  ==============  ============================================= ======
  7. * @(7)                 --Sort Column Block and Adjacent Text             44
  8. *                           in DESCENDING Order  (Tim Farley)
  9. * @(9)                 --Sort Column Block and Adjacent Text             13
  10. *                           CASE INSENSITIVE
  11. * @(0)                 --Sort Column Block and Adjacent Text             43
  12. *                           in REVERSE Order
  13. *
  14. * @(2)                 --Sort Column Block in DESCENDING Order,          43
  15. *                           Adjacent Text Unchanged
  16. * @(8)                 --Sort Column Block RANDOMLY,                     33
  17. *                           Adjacent Text Unchanged
  18. *
  19. * @(3)                 --Convert Vertical to Horizontal Column Block     38
  20. * @(4)                 --Convert Horizontal to Vertical Column Block     47
  21. * @(5)                 --Convert Vertical to Horizontal Column Block,    34
  22. *                           Horizontal Entries NOT Separated by Space
  23. * @(6)                 --Convert Horizontal to Vertical Column Block,    44
  24. *                           Horizontal Entries NOT Separated by Space
  25. *         {e:\up\RFRM*}--Return To RFRMxx.QM
  26. *
  27. *-- eoi
  28.  
  29. * 
  30. * ----------------------------------------------------------------------
  31. * @(2) Sort Column Block In Descending Order,
  32. *      Adjacent Text Unchanged
  33. * ----------------------------------------------------------------------
  34. * This macro sorts only the entries in a column block in reverse order.
  35. * It leaves all text surrounding the column block in the same position
  36. * before and after.  See @7 for limitations.
  37.  
  38. @2 macrobegin
  39.         OneWindow
  40.         GotoBlockBeg
  41.  JFalse ENDSORT:
  42.         EditFile "NUL" Return
  43.         Quit
  44.         GoToBlockBeg
  45.         EditFile Return
  46.         MoveBlock
  47.         Sort
  48.  DELALL:
  49.         DelLine
  50.  JTrue DELALL:
  51.         UnKill
  52.  UNDELALL:
  53.         CursorDown
  54.         UnKill
  55.  JTrue UNDELALL:
  56.         DelLine
  57.         CursorUp
  58.         EndLine
  59.         CursorLeft
  60.         Markcolumn
  61.         BegFile
  62.         Cut
  63.         Quit
  64.         Paste
  65.         UnMarkBlock
  66.  ENDSORT:
  67. *
  68. * 59 bytes Tue  04-20-1991  11:13:21 (TF @0, TH added size)
  69. * 43 bytes Thu  08-15-1991  12:42:05 (TH @2)
  70.  
  71. * Marking col 3:
  72. *                               v
  73. *                 0     0      877     0
  74. *                 1     1      abc     1
  75. *                 2     2      275     2
  76. *                 3     3      970     3
  77. *                 4     4      345     4
  78. *                 5     5      615     5
  79. *                 6     6      075     6
  80. *                 7     7      710     7
  81. *                 8     8      186     8
  82. *                 9     9      421     9
  83. *                 a     a      DEF     a
  84. *                 b     b      520     b
  85. * becomes
  86. *                 0     0      abc     0
  87. *                 1     1      DEF     1
  88. *                 2     2      970     2
  89. *                 3     3      877     3
  90. *                 4     4      710     4
  91. *                 5     5      615     5
  92. *                 6     6      520     6
  93. *                 7     7      421     7
  94. *                 8     8      345     8
  95. *                 9     9      275     9
  96. *                 a     a      186     a
  97. *                 b     b      075     b
  98.  
  99. * 
  100. * ----------------------------------------------------------------------
  101. * @(3)  Convert Vertical to Horizontal Column Block
  102. *       With Horizontal Entries Separated by a Single Space
  103. * ----------------------------------------------------------------------
  104. * This macro converts a vertical column block to a horizontal single
  105. * line column block with horizontal entries separated by a single
  106. * space.  Block may be open or closed.
  107.  
  108. *     1 becomes 1 2 3
  109. *     2
  110. *     3
  111.  
  112. @3      MacroBegin
  113.         OneWindow                   *
  114.         EditFile "NUL" Return       * Edit NUL file
  115.         Quit                        * Quit NUL file if loaded
  116.         GotoBlockBeg                * Return to where we started
  117.     jfalse END:                     * If not closed, nothing was marked, end
  118.         HorizontalWindow            * Make window 2
  119.         EditFile Return             * Load NUL
  120.         MoveBlock                   * Move block to NULs8
  121.     LOOP:                           *
  122.         EndLine                     * Move to char after last in line
  123. *-- JoinLine with single space at join point, per JG
  124.         CursorRight                 * Make 2 spaces
  125.         CursorRight                 *
  126.         JoinLine                    * Join line
  127.         CursorLeft                  *
  128.         DelRtWord                   * Make one space
  129. *--                                 *
  130.    jtrue LOOP:                      * Loop until done
  131.         EndLine                     * Position for mark
  132.         MarkCharacter               * Mark line as character block
  133.         Cut                         * Cut new block to scrap
  134.         Quit                        * Quit NUL
  135.         PrevWindow                  * Return to file we started in
  136.         OneWindow                   * Close all windows
  137.         Paste                       * Paste new block back at start of old
  138.    END:                             *
  139. *       UnmarkBlock                 * Unmark new block
  140. *
  141. * 38 bytes Thu  08-15-1991  15:35:40 (TH @3)
  142.  
  143. * 
  144. * ----------------------------------------------------------------------
  145. * @(4)  Convert Horizontal to Vertical Column Block,
  146. *       Horizontal Entries Separated by Space
  147. * ----------------------------------------------------------------------
  148. * This macro converts a horizontal single line column block, with
  149. * horizontal entries separated by a single space, to a vertical column
  150. * block.  Block may be open or closed.
  151.  
  152. *     1 2 3 becomes 1
  153. *                   2
  154. *                   3
  155.  
  156. @4      MacroBegin
  157.         OneWindow                   *
  158.         AltWordSet                  * For all block entries
  159.         EditFile "NUL" Return       * Edit NUL file
  160.         Quit                        * Quit NUL file if loaded
  161.         GotoBlockBeg                * Return to where we started
  162.     jfalse END:                     * If not closed, nothing was marked, end
  163.         HorizontalWindow            * Make window 2
  164.         EditFile Return             * Load NUL
  165.         MoveBlock                   * Move block to NULs8
  166.         UnmarkBlock                 * Unmark block for screen appearance
  167.         WordRight                   * Move to second entry in block
  168.     LOOP:                           *
  169.         EndLine                     * Test if at end of line
  170.      Jfalse NEXT:                   * If so, we're done splitting
  171.         PrevPosition                *ELSE return to where we were
  172.         CursorLeft                  * Move left to blank space
  173.         DelCh                       * Delete blank space
  174.         SplitLine                   * Split line
  175.         WordRight                   * Move to column entry we just split
  176.         WordRight                   * Move to next column entry to split
  177.     jump LOOP:                      * Loop again
  178.     NEXT:                           * Come here when finished splitting
  179.         CursorLeft                  * Position cursor on last char in block
  180.         MarkColumn                  * Start column block mark on last char
  181.         BegFile                     * Get all column as block
  182.         Cut                         * Cut new block to scrap
  183.         Quit                        * Quit NUL
  184.         PrevWindow                  * Return to file we started in
  185.         OneWindow                   * Close all windows
  186.         Paste                       * Paste new block back at start of old
  187.    END:                             *
  188.         DefaultWordSet              * Reset
  189. *       UnmarkBlock                 * Unmark new block
  190. *
  191. * 47 bytes Thu  08-15-1991  15:36:00 (TH @4)
  192.  
  193. * 
  194. * ----------------------------------------------------------------------
  195. * @(5)  Convert Vertical to Horizontal Column Block
  196. *       With Horizontal Entries NOT Separated by a Single Space
  197. * ----------------------------------------------------------------------
  198. * This macro converts a vertical column block to a horizontal single
  199. * line column block with horizontal entries NOT separated by a single
  200. * space.  Block may be open or closed.
  201.  
  202. *     1 becomes 123
  203. *     2
  204. *     3
  205.  
  206. @5      MacroBegin
  207.         OneWindow                   *
  208.         EditFile "NUL" Return       * Edit NUL file
  209.         Quit                        * Quit NUL file if loaded
  210.         GotoBlockBeg                * Return to where we started
  211.     jfalse END:                     * If not closed, nothing was marked, end
  212.         HorizontalWindow            * Make window 2
  213.         EditFile Return             * Load NUL
  214.         MoveBlock                   * Move block to NUL
  215.     LOOP:
  216.         EndLine                     * Move to char after last in line
  217.         JoinLine                    * Join line
  218.    jtrue LOOP:                      * Loop until done
  219.         EndLine                     * Position for mark
  220.         MarkCharacter               * Mark line as character block
  221.         Cut                         * Cut new block to scrap
  222.         Quit                        * Quit NUL
  223.         PrevWindow                  * Return to file we started in
  224.         OneWindow                   * Close all windows
  225.         Paste                       * Paste new block back at start of old
  226.    END:                             *
  227. *       UnmarkBlock                 * Unmark new block
  228. *
  229. * 34 bytes Thu  08-15-1991  15:39:00 (TH @5)
  230.  
  231. * 
  232. * ----------------------------------------------------------------------
  233. * @(6)  Convert Horizontal to Vertical Column Block,
  234. *       Horizontal Entries NOT Separated by Space
  235. * ----------------------------------------------------------------------
  236. * This macro converts a horizontal single line column block, with
  237. * horizontal entries NOT separated by a single space, to a vertical
  238. * column block.  Block may be open or closed.
  239.  
  240. *      123 becomes 1
  241. *                  2
  242. *                  3
  243.  
  244. @6      MacroBegin
  245.         OneWindow                   *
  246.         EditFile "NUL" Return       * Edit NUL file
  247.         Quit                        * Quit NUL file if loaded
  248.         GotoBlockBeg                * Return to where we started
  249.     jfalse END:                     * If not closed, nothing was marked, end
  250.         HorizontalWindow            * Make window 2
  251.         EditFile Return             * Load NUL
  252.         MoveBlock                   * Move block to NUL
  253.         UnmarkBlock                 * Unmark block for screen appearance
  254.     LOOP:                           *
  255.         CursorRight                 * Move to next char
  256.         SplitLine                   * Split line
  257.         Begline                     * Back to begline
  258.         CursorDown                  * Move down to next line
  259.         EndLine                     * Test if line is blank
  260.     Jfalse NEXT:                    * If so, we're done splitting
  261.         PrevPosition                *ELSE return to where we were
  262.     jump LOOP:                      * Loop again
  263.     NEXT:                           * Come here when finished splitting
  264.         CursorUp                    * Move up to last char line
  265.         BegLine                     * Position cursor on last char in block
  266.         MarkColumn                  * Start column block mark on last char
  267.         BegFile                     * Get all column as block
  268.         Cut                         * Cut new block to scrap
  269.         Quit                        * Quit NUL
  270.         PrevWindow                  * Return to file we started in
  271.         OneWindow                   * Close all windows
  272.         Paste                       * Paste new block back at start of old
  273.    END:                             *
  274. *       UnmarkBlock                 * Unmark new block
  275. *
  276. * 44 bytes Thu  08-15-1991  15:40:21 (TH @6)
  277.  
  278. * 
  279. * ----------------------------------------------------------------
  280. * @(7) Sort Column Block and Adjacent Text In Descending Order
  281. *      Written by Tim Farley with Modifications by Tom Hogshead
  282. * ---------------------------------------------------------------
  283. * This macro is a modification to a macro written by Tim Farley of
  284. * SemWare in Macros Conference 3, Message #60, 4/30/90, to sort a
  285. * column block and all adjacent text in reverse or descending order.  I
  286. * was working on some sorting macros and found quite by accident that
  287. * Tim's macro was inadvertently deleting a line.  I found I could
  288. * correct this condition by removing one extra "DelLine CursorUp".  At
  289. * the same time I went ahead and changed Tim's non-existent temporary
  290. * file to NUL, which is faster especially in large directories, quit
  291. * NUL first, in case it was already loaded, to insure correct ring
  292. * positions, and moved DelLine to delete the extra blank lines, to
  293. * delete it while in the NUL file, not the current file.
  294.  
  295. * @7 has the same effect on lines containing the column block as does
  296. * 'sort', ie text adjacent to the column block is sorted also.  Tim's
  297. * idea using the Kill Buffer to reverse sort lines is very creative.  As
  298. * he suggested, I set QConfig Kill Buffer 300 lines.  Thanks again to
  299. * Tim for the macro.  It has been useful lately, and has been the basis
  300. * for developing the other sorting macros here.
  301.  
  302. * As an example using @7, col 1 marked as an open or closed column
  303. * block, and all adjacent text is sorted in reverse order as shown in
  304. * col 2:
  305.  
  306. *                         Before          After
  307. *                        ========        =======
  308. *                           v
  309. *                          877             abc
  310. *                          abc             DEF
  311. *                          275             970
  312. *                          970             877
  313. *                          345             710
  314. *                          615             615
  315. *                          075             520
  316. *                          710             421
  317. *                          186             345
  318. *                          421             275
  319. *                          DEF             186
  320. *                          520             075
  321.  
  322. * Similarly marking col 3 here:
  323. *                                       v
  324. *                         0     0      877     0
  325. *                         1     1      abc     1
  326. *                         2     2      275     2
  327. *                         3     3      970     3
  328. *                         4     4      345     4
  329. *                         5     5      615     5
  330. *                         6     6      075     6
  331. *                         7     7      710     7
  332. *                         8     8      186     8
  333. *                         9     9      421     9
  334. *                         a     a      DEF     a
  335. *                         b     b      520     b
  336.  
  337. * becomes
  338.  
  339. *                         1     1      abc     1
  340. *                         a     a      DEF     a
  341. *                         3     3      970     3
  342. *                         0     0      877     0
  343. *                         7     7      710     7
  344. *                         5     5      615     5
  345. *                         b     b      520     b
  346. *                         9     9      421     9
  347. *                         4     4      345     4
  348. *                         2     2      275     2
  349. *                         8     8      186     8
  350. *                         6     6      075     6
  351.  
  352. * NOTE:  Since this macro uses the Kill Buffer to reverse the
  353. *        lines, it cannot sort more lines than will fit in your
  354. *        Kill Buffer.  See (G)eneral options in the configuration
  355. *        program for setting this value--it defaults to only 30
  356. *        lines so BE CAREFUL!  I set the maximum number of
  357. *        Kill Buffer entries to 300.
  358. *
  359. * Do NOTE the notation in the comment:  you are limited to the size
  360. * of your Kill Buffer with this macro.
  361.  
  362. @7 macrobegin
  363.         GotoBlockBeg
  364.         OneWindow
  365.         Sort
  366.         EditFile "NUL" Return               *|
  367.         Quit                                *|
  368.         GotoBlockEnd
  369.     JFalse ENDSORT:                         *|b
  370.         MarkLine
  371.         EditFile Return                     *|
  372.         MoveBlock
  373. *         DelLine                           *|b
  374.     DELALL:
  375.         DelLine
  376.     JTrue DELALL:
  377. *         UnKill                            *|b
  378.     UNDELALL:
  379.         CursorDown
  380.         UnKill
  381.     JTrue UNDELALL:
  382.         DelLine
  383.         CursorUp
  384.         MarkLine
  385.         BegFile
  386.         DelLine                             *|
  387.         PrevFile
  388.         MoveBlock
  389.         NextFile
  390.         Quit
  391.         GotoBlockBeg
  392.         UnMarkBlock
  393.     ENDSORT:
  394. *
  395. * 59 bytes Tue  04-20-1991  11:13:21 (TF @0, TH added size line)
  396. * 46 bytes Thu  08-15-1991  12:42:26 (TH @7, mod to Tim Farley @0 |)
  397. * 44 bytes Sun  08-25-1991  17:38:41 (TH @7, |b)
  398.  
  399. * 
  400. * ----------------------------------------------------------------------
  401. * @(8) Randomly Sort a Column Block of Up to 999 Entries
  402. * ----------------------------------------------------------------------
  403. * To run, mark a column block to be randomly sorted, either open or
  404. * closed.  This macro will randomly sort up to 999 entries in a column
  405. * block and leave the text adjacent to the column block in it's
  406. * original position.  The results are the same as randomly sorting a
  407. * one dimmensional matrix composed of entries in the column block.
  408.  
  409. * A file named RAND containing numbers 1 to 999 randomly sorted is used
  410. * as the sorting key.  A temporary block containing both the block to
  411. * be sorted adjacent to the random numbers is sorted using the random
  412. * numbers as the sort key.  Thus, sorting the random numbers into an
  413. * ascending sorted set sorts the original marked block into a random
  414. * set.  The file RAND must be present in the current directory and is
  415. * included in AMACxx.ZIp.  If RAND does not exist, it can easily made
  416. * by first removing the asterisks and spaces in col 1 in the table
  417. * below, formatting the 999 random sorted numbers to a right margin
  418. * width of 4, and then saving the single column formatted numbers to a
  419. * file named RAND.
  420.  
  421. * As an example, col 1 when marked as an open or closed column block,
  422. * becomes randomly sorted as shown in col 2:
  423.  
  424. *                         Before          After
  425. *                        ========        =======
  426. *                          075             877
  427. *                          186             abc
  428. *                          275             275
  429. *                          345             970
  430. *                          421             345
  431. *                          520             615
  432. *                          615             075
  433. *                          710             710
  434. *                          877             186
  435. *                          970             421
  436. *                          abc             DEF
  437. *                          DEF             520
  438.  
  439. @8      MacroBegin
  440.         EditFile "rand" Return      * Load random number file
  441.         Quit                        * Quit for ring position
  442.         GotoBlockBeg                * Return to where we started
  443.         EditFile Return             * Load random number file as next file
  444.         EndLine CursorRight         * Position one space rt of fist rand #
  445.         MoveBlock                   * Move unsorted block here
  446.         GoToBlockEnd                * Position to re-mark
  447.         UnmarkBlock                 * Unmark
  448.         CursorLeft                  * Pos cur on last char in unsorted block
  449.         MarkColumn                  * Start column block
  450.         BegFile                     * Get random #'s in block
  451.         Sort                        * Sort
  452.         CursorRight CursorRight     * Remove random #'s from block
  453.         CursorRight CursorRight     * Block is now what is was. but random
  454.         PrevFile                    * Return to starting file
  455.         MoveBlock                   * Move random sorted back where it was
  456. *       UnmarkBlock                 * Unmark new block
  457. *
  458. * 33 bytes Sun  08-25-1991  13:52:16 (TH @8)
  459.  
  460. * Numbers 1 to 999 Randomly Sorted
  461. * ---------------------------------
  462.  
  463. * This table contains numbers 1 to 999 randomly sorted.  Statisticians
  464. * will argue this is not 'truly random' and it is not but it is
  465. * sufficiently random for our column block sorting purposes.  There are
  466. * no repeating numbers.  This Table is included as a single column
  467. * file RAND in AMACxx.ZIP.
  468.  
  469. * 487 671 332 471 727 897 478 551 054 371 080 856 987 821 634 338 937
  470. * 614 562 020 171 932 705 601 274 791 824 477 663 552 343 223 288 654
  471. * 273 205 945 480 317 533 903 685 740 725 187 017 722 560 530 842 087
  472. * 777 192 142 452 319 523 208 181 732 704 126 218 014 568 672 780 809
  473. * 517 033 365 940 883 430 024 215 750 426 380 347 774 606 314 433 009
  474. * 377 869 359 836 595 876 963 456 715 929 060 015 658 861 481 773 095
  475. * 799 674 217 212 182 984 018 804 174 151 993 771 520 335 778 386 388
  476. * 858 287 695 465 684 593 522 008 488 123 930 240 119 692 531 267 730
  477. * 437 483 406 472 770 188 742 516 027 905 264 250 807 374 494 915 969
  478. * 967 454 259 137 550 859 589 245 447 213 741 953 958 270 926 957 230
  479. * 952 475 801 868 253 285 921 466 702 130 204 302 819 041 237 282 016
  480. * 207 911 640 418 754 244 308 559 175 114 738 525 792 584 173 553 510
  481. * 950 147 720 779 894 539 977 994 597 411 030 068 665 912 655 689 604
  482. * 822 872 052 443 312 354 440 962 736 546 249 996 986 337 716 034 512
  483. * 134 760 942 381 504 895 128 301 339 619 113 368 825 916 358 254 395
  484. * 690 403 133 966 563 749 390 954 216 242 132 913 664 333 980 726 050
  485. * 112 315 307 449 693 622 806 349 476 887 227 631 382 823 366 444 698
  486. * 796 263 839 350 091 362 446 906 324 460 526 295 814 651 904 461 143
  487. * 981 659 458 177 850 002 805 121 591 127 412 345 222 029 931 110 457
  488. * 224 759 498 751 877 473 746 888 391 555 202 252 363 794 923 387 389
  489. * 509 629 649 164 956 357 160 865 524 628 998 209 180 396 818 681 084
  490. * 815 062 728 739 378 648 505 450 265 623 933 656 206 427 320 574 423
  491. * 492 612 990 666 064 239 178 679 639 183 144 025 844 766 299 556 860
  492. * 616 328 569 641 225 790 266 318 469 573 135 019 441 094 784 892 290
  493. * 321 118 072 511 697 831 808 482 834 548 734 896 420 083 012 590 294
  494. * 322 499 158 811 057 161 786 587 783 146 709 820 832 576 975 733 234
  495. * 255 131 501 810 917 537 138 214 246 982 257 286 088 907 099 355 645
  496. * 624 884 919 846 141 085 793 829 098 409 870 513 694 346 802 109 296
  497. * 617 199 944 714 721 081 871 642 003 683 341 262 280 719 021 983 788
  498. * 878 627 150 102 168 899 464 490 758 922 495 845 946 797 528 397 048
  499. * 067 547 544 340 231 163 170 585 660 854 691 961 139 069 269 789 900
  500. * 518 474 542 575 445 186 889 647 763 169 947 997 298 036 424 063 047
  501. * 251 326 610 643 848 491 276 948 497 538 626 361 309 379 195 633 172
  502. * 713 696 880 106 743 535 260 093 570 400 277 529 289 035 621 484 976
  503. * 191 717 241 800 369 652 124 837 179 413 653 891 762 583 637 198 686
  504. * 767 097 795 292 011 090 376 197 416 885 890 586 306 554 031 037 782
  505. * 863 038 108 840 404 600 724 785 851 422 079 572 442 991 699 949 185
  506. * 051 879 372 284 744 828 712 925 271 383 941 053 951 753 056 431 414
  507. * 233 023 066 293 935 167 272 703 417 010 602 247 909 070 210 965 875
  508. * 155 873 125 992 765 467 657 162 673 960 248 042 370 032 669 615 351
  509. * 618 902 221 843 635 103 540 502 830 157 152 236 256 219 752 040 866
  510. * 228 410 082 421 775 995 356 489 508 959 943 235 914 434 089 327 541
  511. * 360 493 781 156 661 076 682 934 189 149 352 813 166 936 567 978 988
  512. * 565 577 107 367 708 670 353 867 620 927 968 462 769 407 013 459 761
  513. * 201 920 373 688 862 402 608 316 527 772 707 855 632 939 148 581 325
  514. * 086 438 841 566 435 159 348 874 297 448 549 045 220 268 261 344 519
  515. * 468 078 129 756 401 005 607 331 073 419 184 096 582 545 405 729 100
  516. * 432 817 757 677 985 668 609 190 532 194 826 594 058 833 755 710 071
  517. * 979 881 864 662 028 893 193 092 342 507 625 238 074 882 075 455 588
  518. * 394 592 313 375 646 852 229 105 748 723 278 803 334 485 007 111 415
  519. * 731 598 506 928 989 711 910 291 596 901 580 898 768 700 678 203 500
  520. * 451 605 453 153 077 044 835 515 104 004 279 776 065 305 470 999 561
  521. * 857 101 258 399 364 243 816 039 955 329 061 116 310 908 747 043 281
  522. * 336 384 603 972 964 463 571 644 630 226 543 049 650 970 745 787 847
  523. * 176 115 924 812 001 534 687 122 503 667 232 735 304 579 154 398 557
  524. * 886 022 638 680 436 496 145 675 385 006 578 564 392 486 439 059 283
  525. * 211 737 849 429 974 971 136 514 200 718 558 536 599 165 300 701 140
  526. * 117 120 973 838 393 026 613 764 479 196 827 275 408 046 425 706 611
  527. * 311 676 055 918 303 323 938 428 330 636 521 853 798
  528.  
  529. * 
  530. *-------------------------------------------
  531. * @(9) Sort Column Block, Case Insensitive
  532. *-------------------------------------------
  533. * This macro sorts a column block in ascending order and is case
  534. * INSENSITIVE.  I do not know the author, but recall I found it on the
  535. * SemWare BBS.  We copy the sort key block, upper case it, and sort on
  536. * the copy.  Then we delete the copy, leaving the original lines as
  537. * they were, except sorted:
  538.  
  539. @9      macrobegin
  540.         gotoblockbeg
  541.         copyblock
  542.  jfalse NOBLOCK:
  543.         onewindow
  544.         upper
  545.         sort
  546.         deleteblock
  547.  NOBLOCK:
  548. *
  549. * 13 bytes Mon  08-20-1990  07:17:25 (TH @9)
  550.  
  551. * 
  552. * ------------------------------------------
  553. * @(0) Sort Column Block in Reverse Order
  554. * ------------------------------------------
  555. * This macro is based on the technique used by Tim Farley in @7.  @0
  556. * sorts a column block and text outside the column block in REVERSE
  557. * order, not DESCENDING like @7, i.e.  the last column entry becomes the
  558. * first, and so on.  @0 has the same effect on text outside the column
  559. * block as 'sort'.  Results are the same as if the column block were a
  560. * one dimmensional matrix and it was inverted.
  561.  
  562. * NOTE:  Since this macro uses the Kill Buffer to reverse the
  563. *        lines, it cannot sort more lines than will fit in your
  564. *        Kill Buffer.  See (G)eneral options in the configuration
  565. *        program for setting this value--it defaults to only 30
  566. *        entries in column block. I set the maximum number of
  567. *        Kill Buffer entries to 300.
  568.  
  569. * Do NOTE the notation in the comment:  you are limited to the size
  570. * of your Kill Buffer with this macro.
  571.  
  572. *                         Before          After
  573. *                        ========        =======
  574. *                          abc             075
  575. *                          DEF             186
  576. *                          970             275
  577. *                          877             345
  578. *                          710             421
  579. *                          615             520
  580. *                          520             615
  581. *                          421             710
  582. *                          345             877
  583. *                          275             970
  584. *                          186             DEF
  585. *                          075             abc
  586.  
  587. @0 macrobegin
  588.         OneWindow
  589.         GotoBlockBeg
  590.         EditFile "NUL" Return
  591.         Quit
  592.         GotoBlockEnd
  593.  JFalse ENDSORT:
  594.         MarkLine
  595.         EditFile Return
  596.         MoveBlock
  597.  DELALL:
  598.         DelLine
  599.  JTrue DELALL:
  600.  UNDELALL:
  601.         CursorDown
  602.         UnKill
  603.  JTrue UNDELALL:
  604.         DelLine CursorUp
  605.         MarkLine
  606.         BegFile
  607.         CursorDown
  608.         PrevFile
  609.         MoveBlock
  610.         NextFile
  611.         Quit
  612.         GotoBlockBeg
  613.         UnMarkBlock
  614.  ENDSORT:
  615. *
  616. * 43 bytes Sun  08-25-1991  17:23:40 (TH @0)
  617.